{% extends "base.html" %} 

{% block content %}
<h1 class="pl-2">Book List</h1>

{% if book_list %}
<ul>

    {% for book in book_list %}
    <div class="card mb-3" style="max-width: 20rem;">
        <div class="card-header">
            <a href="{{ book.get_absolute_url }}">{{ book.title }}</a>
        </div>
        <div class="card-body">
            <p class="card-title"><div class="text-success">Author:</div> <a href="{{ book.author.get_absolute_url }}">{{book.author}}</a></p>
            <p class="card-text"><div class="text-success">Summary:</div> {{ book.summary }}</p>
        </div>
    </div>
    {% endfor %}

</ul>
{% else %}
<p>There are no books in the library.</p>
{% endif %} {% endblock %}